package com.jason.www.pubsub.listener;


import com.jason.www.pubsub.core.BossApplicationListener;
import com.jason.www.pubsub.event.SendEmailEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class SendEmailEventListener implements BossApplicationListener<SendEmailEvent> {
    private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());

    @Override
    public void onListen(SendEmailEvent sendEmailEvent) {
        String userName = sendEmailEvent.getUserName();
        String msg = sendEmailEvent.getMsg();
        //这里执行真正发送邮件的操作...
        LOGGER.error("给" + userName + "异步发送邮件:" + msg);
    }
}
